﻿using System.Collections.Generic;
using System.Web.WebPages;
using Website.Infrastructure;

namespace Website
{
    public static class DisplayConfig
    {
        public static void RegisterDisplayModes(IList<IDisplayMode> modes, DeviceDetectorFactory factory)
        {
            // Register different DisplayModeProviders for phone and tablet devices
            modes.Insert(0, new DefaultDisplayMode("Phone")
            {
                ContextCondition = (ctx => factory.Create(ctx.GetOverriddenUserAgent()).IsPhoneDevice())
            });

            modes.Insert(0, new DefaultDisplayMode("Tablet")
            {
                ContextCondition = (ctx => factory.Create(ctx.GetOverriddenUserAgent()).IsTabletDevice())
            });
        }
    }
}